﻿using BCCommon;
using BCCommon.TMS.MarketingCoupon;
using BCDto.Sim.Admin.Admin;
using BCDto.TMS.MarketingCoupon.MarketingCoupon;
using BCDto.TMS.MarketingCoupon.MarketingCouponType;
using BCDto.Website.User;
using System.Collections.Generic;

namespace BCService.TMS.MarketingCoupon.MarketingCoupon
{
    public interface IMarketingCouponService
    {

        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="marketingCouponId">优惠券Id</param>
        /// <returns></returns>
        MarketingCouponDto GetSingle(long marketingCouponId);
        /// <summary>
        /// 获取优惠券分页
        /// </summary>
        /// <param name="marketingCouponTypeId">优惠券类型</param>
        /// <param name="isReceive">是否领取</param>
        /// <param name="isUse">是否使用</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageableList<MarketingCouponDto> Query(long marketingCouponTypeId, bool? isReceive,bool? isUse, int pageIndex, int pageSize);
        /// <summary>
        /// 获取优惠券总数量
        /// </summary>
        /// <returns></returns>
        MarketingCouponCountDto GetAllCount(AdminDto admin);
        #region 用户端
        /// <summary>
        /// 获取当前客户可领取的优惠券
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="countyCode">区编码</param>
        /// <returns></returns>
        IEnumerable<MarketingCouponTypeDto> GetCanReceiveList(UserDto userInfo, string countyCode);
        /// <summary>
        /// 领取优惠券
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="marketingCouponTypeId">优惠券类型id</param>
        /// <param name="countyCode">区编码</param>
        /// <returns></returns>
        bool ReceiveMarketingCoupon(UserDto userInfo, long marketingCouponTypeId, string countyCode);
        /// <summary>
        /// 获取可以使用的优惠券
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="vehicleTransportBusinessConfigId">运输类型id</param>
        /// <param name="countyCode">地区编码</param>
        /// <returns></returns>
        IEnumerable<MarketingCouponDto> GetCanUseList(UserDto userInfo, long vehicleTransportBusinessConfigId, string countyCode);
        /// <summary>
        /// 使用优惠券
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="marketingCouponId">优惠券id</param>
        /// <param name="countyCode">区编码</param>
        /// <param name="orderId">用户id</param>
        /// <returns></returns>
        bool UseMarketingCoupon(UserDto userInfo, long marketingCouponId, string countyCode,long orderId);
        /// <summary>
        /// 获取用户优惠券列表
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="marketingCouponStatus">优惠券状态</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageableList<MarketingCouponDto> GetMarketingCouponList(long userId, MarketingCouponStatusEnum? marketingCouponStatus, int pageIndex, int pageSize);
        /// <summary>
        /// 删除优惠券
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="marketingCouponId">优惠券id</param>
        /// <returns></returns>
        bool Delete(long userId, long marketingCouponId);
        #endregion
    }
}
